<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="ko">
<head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     <title>multipleResult.jsp</title>
     
     <style type="text/css">
          #result_ul>li>label {
               display: inline-block;
               width: 70px;
          }
          
          #result_ul>li>input {
               display: inline-block;
               width: 200px;
          }
          
          #request_form>div {
               margin-left: 70px;
          }
          
          #reBtn {
               width: 80px;
               padding: 4px;
          }
     </style>
</head>
<body>
     <%
          int x = Integer.parseInt(request.getParameter("num1"));     
          int y = Integer.parseInt(request.getParameter("num2"));
          
          String strX = request.getParameter("num1");
          String strY = request.getParameter("num2");
          
          
          String str3 = new String("");
          
          if (x%3 == 0) str3 += strX;     
          if (y%3 == 0) str3 += strY;
          if (x%3 == 0 && y%3 == 0) str3 = strX + ", " + strY;
          
          if (str3.length() == 0) str3 = "해당하는 숫자가 없습니다.";
          
          
          String str7 = new String("");
          
          if (x%7 == 0) str7 += strX;     
          if (y%7 == 0) str7 += strY;
          if (x%7 == 0 && y%7 == 0) str7 = strX + ", " + strY;
          
          if (str7.length() == 0) str7 = "해당하는 숫자가 없습니다.";
          
     %>
     
     <ul id="result_ul">
          <li><label>3의 배수</label><input type="text" name="num3" id="num3" value="<%=str3 %>" />
          <li><label>7의 배수</label><input type="text" name="num7" id="num7" value="<%=str7 %>" />
     </ul>
          
     <input type="button" id="reBtn" value="다시 입력" onclick="location.href='main.jsp?inc=./jsp/multiple.jsp'" />
     
</body>
</html>